import { getUserRoom } from "@/api/room";
import type { rooms } from "@/props/room";
import { defineStore } from "pinia";
import { reactive, ref } from "vue";

export const useRoomStore = defineStore("room",()=>{
  const showOnPage = ref(false)

  const showOnCollectionsPage = ref(false)

  const roomData = reactive<rooms>([])

  const dataUserRoom = async() =>{
    const {data} = await getUserRoom();
    roomData.splice(0,roomData.length,...data.data)
  }

  return {showOnPage,roomData,dataUserRoom,showOnCollectionsPage}
})
